<template>
  <div class="lineDetail">
    <MetroHead :headTitle="headTitle" />
    <h1>线路:{{ list.name }}</h1>
    <p>
      班车时间：<span>{{ list.startTime }}-{{ list.endTime }}</span>
    </p>
    <p>
      起点站：<span>{{ list.first }}</span> 终点站：<span>{{ list.end }}</span>
    </p>
    <div class="line">
      <h1>路线途径站点</h1>
      <div v-for="(item) in list.metroStepList" :key="item.id">
        <p>
          {{ item.name }}
        </p>
      </div>
    </div>
  </div>
</template>

<script>
import { CityDetailApi } from "@/service/metro/metroservice";
import MetroHead from "../metrohead/MetroHead.vue";
export default {
  data() {
    return {
      list: [],
      headTitle: "站点线路详情",
    };
  },
  async created() {
    let id = this.$route.query.id;
    let { data } = await CityDetailApi(id);
    console.log(data);
    if (data.code == 200) {
      this.list = data.data;
      console.log(this.list);
    }
  },
  components: {
    MetroHead,
  },
};
</script>

<style lang="scss" scoped>
.lineDetail {
  padding-bottom: 45px;
  h1 {
    text-align: center;
    font-size: 24px;
    margin-bottom: 15px;
    margin-top: 10px;
  }
  p {
    font-size: 20px;
    font-weight: bold;
    span {
      font-size: 16px;
    }
  }
  .line{
    text-align: center;
  }
}
</style>